Skip to content

Add Moderation API and stable response types - #4

Merged
winrid merged 8 commits into
masterfrom
regen-moderation-api
Jun 19, 2026
Merged

Add Moderation API and stable response types#4
winrid merged 8 commits into
masterfrom
regen-moderation-api

Conversation

@winrid

@winrid winrid commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Moderation API

Adds a Moderation API with methods for the moderator dashboard:

  • Comments — list, count, fetch by id(s) and children, get/set comment text, logs, export, search (users / pages / sites / comments), suggestions
  • Moderation actions — remove / restore, flag / un-flag, set review / spam / approval status, adjust / cast / delete votes, reopen / close thread
  • Bans — ban from comment, undo ban, pre-ban and bulk pre-ban summaries, comment ban status, ban preferences, banned-user counts and lookup
  • Badges & trust — award / remove badge, manual badges, get / set trust factor, user internal profile

All Moderation methods accept an sso parameter for SSO-authenticated moderators.

Response types (breaking)

Each method now returns its success response type directly, with errors surfaced as a default error response, instead of the previous combined success-or-error return type. The response type names are now stable. Response shapes are unchanged.

Recommend a major version bump.

Regenerated the cpp-restsdk client and markdown docs from the updated
OpenAPI spec (mirrors fastcomments-sdk@4.0.0).

- New Moderation API: 43 moderator-dashboard endpoints (ModerationApi
  class), covering comment moderation (list/count/ids/search/logs/export),
  moderation actions (remove/restore, flag/un-flag, review/spam/approval
  status, set text, votes, reopen/close thread), bans (ban/undo, pre-ban +
  bulk summaries, ban status/preferences, banned-user counts), badges &
  trust (award/remove badge, manual badges, get/set trust factor, user
  internal profile). All accept an sso query param.
- BREAKING: response types are now the real success type. Previously every
  endpoint returned an X | APIError union that produced arbitrary wrapper
  types (e.g. *_200_response). Now each operation returns its success type
  directly and APIError is a default error response. Shapes are unchanged.
@winrid winrid changed the title Regenerate SDK: add Moderation API + stable response types Add Moderation API and stable response types Jun 19, 2026
winrid added 7 commits June 18, 2026 22:19
Switch update.sh from the local custom generator jar to the released
@openapitools/openapi-generator-cli, which fixes nested map types
(e.g. translationOverridesByLocale now generates as
std::map<string, std::map<string, string>> instead of std::map<string, std::map>).
…nApi)

The released cpp-restsdk generator silently drops operations whose response types
it can't model (all 43 ModerationApi methods + 11 PublicApi methods), producing an
incomplete SDK that doesn't match the README. Use the FastComments generator build
(which has the nested-map fix and generates the full API) via update.sh.
@winrid
winrid merged commit 2091e56 into master Jun 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant